/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("protobufjs/minimal.js");

// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

$root.C2SAccountRegister = (function() {

    /**
     * Properties of a C2SAccountRegister.
     * @exports IC2SAccountRegister
     * @interface IC2SAccountRegister
     * @property {string|null} [accountName] C2SAccountRegister accountName
     * @property {string|null} [password] C2SAccountRegister password
     */

    /**
     * Constructs a new C2SAccountRegister.
     * @exports C2SAccountRegister
     * @classdesc Represents a C2SAccountRegister.
     * @implements IC2SAccountRegister
     * @constructor
     * @param {IC2SAccountRegister=} [properties] Properties to set
     */
    function C2SAccountRegister(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * C2SAccountRegister accountName.
     * @member {string} accountName
     * @memberof C2SAccountRegister
     * @instance
     */
    C2SAccountRegister.prototype.accountName = "";

    /**
     * C2SAccountRegister password.
     * @member {string} password
     * @memberof C2SAccountRegister
     * @instance
     */
    C2SAccountRegister.prototype.password = "";

    /**
     * Creates a new C2SAccountRegister instance using the specified properties.
     * @function create
     * @memberof C2SAccountRegister
     * @static
     * @param {IC2SAccountRegister=} [properties] Properties to set
     * @returns {C2SAccountRegister} C2SAccountRegister instance
     */
    C2SAccountRegister.create = function create(properties) {
        return new C2SAccountRegister(properties);
    };

    /**
     * Encodes the specified C2SAccountRegister message. Does not implicitly {@link C2SAccountRegister.verify|verify} messages.
     * @function encode
     * @memberof C2SAccountRegister
     * @static
     * @param {IC2SAccountRegister} message C2SAccountRegister message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    C2SAccountRegister.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.accountName != null && Object.hasOwnProperty.call(message, "accountName"))
            writer.uint32(/* id 1, wireType 2 =*/10).string(message.accountName);
        if (message.password != null && Object.hasOwnProperty.call(message, "password"))
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.password);
        return writer;
    };

    /**
     * Encodes the specified C2SAccountRegister message, length delimited. Does not implicitly {@link C2SAccountRegister.verify|verify} messages.
     * @function encodeDelimited
     * @memberof C2SAccountRegister
     * @static
     * @param {IC2SAccountRegister} message C2SAccountRegister message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    C2SAccountRegister.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a C2SAccountRegister message from the specified reader or buffer.
     * @function decode
     * @memberof C2SAccountRegister
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {C2SAccountRegister} C2SAccountRegister
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    C2SAccountRegister.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.C2SAccountRegister();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.accountName = reader.string();
                    break;
                }
            case 2: {
                    message.password = reader.string();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a C2SAccountRegister message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof C2SAccountRegister
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {C2SAccountRegister} C2SAccountRegister
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    C2SAccountRegister.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a C2SAccountRegister message.
     * @function verify
     * @memberof C2SAccountRegister
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    C2SAccountRegister.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.accountName != null && message.hasOwnProperty("accountName"))
            if (!$util.isString(message.accountName))
                return "accountName: string expected";
        if (message.password != null && message.hasOwnProperty("password"))
            if (!$util.isString(message.password))
                return "password: string expected";
        return null;
    };

    /**
     * Creates a C2SAccountRegister message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof C2SAccountRegister
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {C2SAccountRegister} C2SAccountRegister
     */
    C2SAccountRegister.fromObject = function fromObject(object) {
        if (object instanceof $root.C2SAccountRegister)
            return object;
        var message = new $root.C2SAccountRegister();
        if (object.accountName != null)
            message.accountName = String(object.accountName);
        if (object.password != null)
            message.password = String(object.password);
        return message;
    };

    /**
     * Creates a plain object from a C2SAccountRegister message. Also converts values to other types if specified.
     * @function toObject
     * @memberof C2SAccountRegister
     * @static
     * @param {C2SAccountRegister} message C2SAccountRegister
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    C2SAccountRegister.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            object.accountName = "";
            object.password = "";
        }
        if (message.accountName != null && message.hasOwnProperty("accountName"))
            object.accountName = message.accountName;
        if (message.password != null && message.hasOwnProperty("password"))
            object.password = message.password;
        return object;
    };

    /**
     * Converts this C2SAccountRegister to JSON.
     * @function toJSON
     * @memberof C2SAccountRegister
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    C2SAccountRegister.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for C2SAccountRegister
     * @function getTypeUrl
     * @memberof C2SAccountRegister
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    C2SAccountRegister.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/C2SAccountRegister";
    };

    return C2SAccountRegister;
})();

$root.S2CAccountRegister = (function() {

    /**
     * Properties of a S2CAccountRegister.
     * @exports IS2CAccountRegister
     * @interface IS2CAccountRegister
     * @property {boolean|null} [success] S2CAccountRegister success
     */

    /**
     * Constructs a new S2CAccountRegister.
     * @exports S2CAccountRegister
     * @classdesc Represents a S2CAccountRegister.
     * @implements IS2CAccountRegister
     * @constructor
     * @param {IS2CAccountRegister=} [properties] Properties to set
     */
    function S2CAccountRegister(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * S2CAccountRegister success.
     * @member {boolean} success
     * @memberof S2CAccountRegister
     * @instance
     */
    S2CAccountRegister.prototype.success = false;

    /**
     * Creates a new S2CAccountRegister instance using the specified properties.
     * @function create
     * @memberof S2CAccountRegister
     * @static
     * @param {IS2CAccountRegister=} [properties] Properties to set
     * @returns {S2CAccountRegister} S2CAccountRegister instance
     */
    S2CAccountRegister.create = function create(properties) {
        return new S2CAccountRegister(properties);
    };

    /**
     * Encodes the specified S2CAccountRegister message. Does not implicitly {@link S2CAccountRegister.verify|verify} messages.
     * @function encode
     * @memberof S2CAccountRegister
     * @static
     * @param {IS2CAccountRegister} message S2CAccountRegister message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    S2CAccountRegister.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.success != null && Object.hasOwnProperty.call(message, "success"))
            writer.uint32(/* id 1, wireType 0 =*/8).bool(message.success);
        return writer;
    };

    /**
     * Encodes the specified S2CAccountRegister message, length delimited. Does not implicitly {@link S2CAccountRegister.verify|verify} messages.
     * @function encodeDelimited
     * @memberof S2CAccountRegister
     * @static
     * @param {IS2CAccountRegister} message S2CAccountRegister message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    S2CAccountRegister.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a S2CAccountRegister message from the specified reader or buffer.
     * @function decode
     * @memberof S2CAccountRegister
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {S2CAccountRegister} S2CAccountRegister
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    S2CAccountRegister.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.S2CAccountRegister();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.success = reader.bool();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a S2CAccountRegister message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof S2CAccountRegister
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {S2CAccountRegister} S2CAccountRegister
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    S2CAccountRegister.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a S2CAccountRegister message.
     * @function verify
     * @memberof S2CAccountRegister
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    S2CAccountRegister.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.success != null && message.hasOwnProperty("success"))
            if (typeof message.success !== "boolean")
                return "success: boolean expected";
        return null;
    };

    /**
     * Creates a S2CAccountRegister message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof S2CAccountRegister
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {S2CAccountRegister} S2CAccountRegister
     */
    S2CAccountRegister.fromObject = function fromObject(object) {
        if (object instanceof $root.S2CAccountRegister)
            return object;
        var message = new $root.S2CAccountRegister();
        if (object.success != null)
            message.success = Boolean(object.success);
        return message;
    };

    /**
     * Creates a plain object from a S2CAccountRegister message. Also converts values to other types if specified.
     * @function toObject
     * @memberof S2CAccountRegister
     * @static
     * @param {S2CAccountRegister} message S2CAccountRegister
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    S2CAccountRegister.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults)
            object.success = false;
        if (message.success != null && message.hasOwnProperty("success"))
            object.success = message.success;
        return object;
    };

    /**
     * Converts this S2CAccountRegister to JSON.
     * @function toJSON
     * @memberof S2CAccountRegister
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    S2CAccountRegister.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for S2CAccountRegister
     * @function getTypeUrl
     * @memberof S2CAccountRegister
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    S2CAccountRegister.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/S2CAccountRegister";
    };

    return S2CAccountRegister;
})();

$root.SimpleRole = (function() {

    /**
     * Properties of a SimpleRole.
     * @exports ISimpleRole
     * @interface ISimpleRole
     * @property {number|Long|null} [roleId] SimpleRole roleId
     * @property {string|null} [name] SimpleRole name
     * @property {number|null} [level] SimpleRole level
     */

    /**
     * Constructs a new SimpleRole.
     * @exports SimpleRole
     * @classdesc Represents a SimpleRole.
     * @implements ISimpleRole
     * @constructor
     * @param {ISimpleRole=} [properties] Properties to set
     */
    function SimpleRole(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * SimpleRole roleId.
     * @member {number|Long} roleId
     * @memberof SimpleRole
     * @instance
     */
    SimpleRole.prototype.roleId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

    /**
     * SimpleRole name.
     * @member {string} name
     * @memberof SimpleRole
     * @instance
     */
    SimpleRole.prototype.name = "";

    /**
     * SimpleRole level.
     * @member {number} level
     * @memberof SimpleRole
     * @instance
     */
    SimpleRole.prototype.level = 0;

    /**
     * Creates a new SimpleRole instance using the specified properties.
     * @function create
     * @memberof SimpleRole
     * @static
     * @param {ISimpleRole=} [properties] Properties to set
     * @returns {SimpleRole} SimpleRole instance
     */
    SimpleRole.create = function create(properties) {
        return new SimpleRole(properties);
    };

    /**
     * Encodes the specified SimpleRole message. Does not implicitly {@link SimpleRole.verify|verify} messages.
     * @function encode
     * @memberof SimpleRole
     * @static
     * @param {ISimpleRole} message SimpleRole message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    SimpleRole.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.roleId != null && Object.hasOwnProperty.call(message, "roleId"))
            writer.uint32(/* id 1, wireType 0 =*/8).int64(message.roleId);
        if (message.name != null && Object.hasOwnProperty.call(message, "name"))
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
        if (message.level != null && Object.hasOwnProperty.call(message, "level"))
            writer.uint32(/* id 3, wireType 0 =*/24).int32(message.level);
        return writer;
    };

    /**
     * Encodes the specified SimpleRole message, length delimited. Does not implicitly {@link SimpleRole.verify|verify} messages.
     * @function encodeDelimited
     * @memberof SimpleRole
     * @static
     * @param {ISimpleRole} message SimpleRole message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    SimpleRole.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a SimpleRole message from the specified reader or buffer.
     * @function decode
     * @memberof SimpleRole
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {SimpleRole} SimpleRole
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    SimpleRole.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SimpleRole();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.roleId = reader.int64();
                    break;
                }
            case 2: {
                    message.name = reader.string();
                    break;
                }
            case 3: {
                    message.level = reader.int32();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a SimpleRole message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof SimpleRole
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {SimpleRole} SimpleRole
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    SimpleRole.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a SimpleRole message.
     * @function verify
     * @memberof SimpleRole
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    SimpleRole.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.roleId != null && message.hasOwnProperty("roleId"))
            if (!$util.isInteger(message.roleId) && !(message.roleId && $util.isInteger(message.roleId.low) && $util.isInteger(message.roleId.high)))
                return "roleId: integer|Long expected";
        if (message.name != null && message.hasOwnProperty("name"))
            if (!$util.isString(message.name))
                return "name: string expected";
        if (message.level != null && message.hasOwnProperty("level"))
            if (!$util.isInteger(message.level))
                return "level: integer expected";
        return null;
    };

    /**
     * Creates a SimpleRole message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof SimpleRole
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {SimpleRole} SimpleRole
     */
    SimpleRole.fromObject = function fromObject(object) {
        if (object instanceof $root.SimpleRole)
            return object;
        var message = new $root.SimpleRole();
        if (object.roleId != null)
            if ($util.Long)
                (message.roleId = $util.Long.fromValue(object.roleId)).unsigned = false;
            else if (typeof object.roleId === "string")
                message.roleId = parseInt(object.roleId, 10);
            else if (typeof object.roleId === "number")
                message.roleId = object.roleId;
            else if (typeof object.roleId === "object")
                message.roleId = new $util.LongBits(object.roleId.low >>> 0, object.roleId.high >>> 0).toNumber();
        if (object.name != null)
            message.name = String(object.name);
        if (object.level != null)
            message.level = object.level | 0;
        return message;
    };

    /**
     * Creates a plain object from a SimpleRole message. Also converts values to other types if specified.
     * @function toObject
     * @memberof SimpleRole
     * @static
     * @param {SimpleRole} message SimpleRole
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    SimpleRole.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            if ($util.Long) {
                var long = new $util.Long(0, 0, false);
                object.roleId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
                object.roleId = options.longs === String ? "0" : 0;
            object.name = "";
            object.level = 0;
        }
        if (message.roleId != null && message.hasOwnProperty("roleId"))
            if (typeof message.roleId === "number")
                object.roleId = options.longs === String ? String(message.roleId) : message.roleId;
            else
                object.roleId = options.longs === String ? $util.Long.prototype.toString.call(message.roleId) : options.longs === Number ? new $util.LongBits(message.roleId.low >>> 0, message.roleId.high >>> 0).toNumber() : message.roleId;
        if (message.name != null && message.hasOwnProperty("name"))
            object.name = message.name;
        if (message.level != null && message.hasOwnProperty("level"))
            object.level = message.level;
        return object;
    };

    /**
     * Converts this SimpleRole to JSON.
     * @function toJSON
     * @memberof SimpleRole
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    SimpleRole.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for SimpleRole
     * @function getTypeUrl
     * @memberof SimpleRole
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    SimpleRole.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/SimpleRole";
    };

    return SimpleRole;
})();

$root.C2SAccountLogin = (function() {

    /**
     * Properties of a C2SAccountLogin.
     * @exports IC2SAccountLogin
     * @interface IC2SAccountLogin
     * @property {string|null} [accountName] C2SAccountLogin accountName
     * @property {string|null} [password] C2SAccountLogin password
     */

    /**
     * Constructs a new C2SAccountLogin.
     * @exports C2SAccountLogin
     * @classdesc Represents a C2SAccountLogin.
     * @implements IC2SAccountLogin
     * @constructor
     * @param {IC2SAccountLogin=} [properties] Properties to set
     */
    function C2SAccountLogin(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * C2SAccountLogin accountName.
     * @member {string} accountName
     * @memberof C2SAccountLogin
     * @instance
     */
    C2SAccountLogin.prototype.accountName = "";

    /**
     * C2SAccountLogin password.
     * @member {string} password
     * @memberof C2SAccountLogin
     * @instance
     */
    C2SAccountLogin.prototype.password = "";

    /**
     * Creates a new C2SAccountLogin instance using the specified properties.
     * @function create
     * @memberof C2SAccountLogin
     * @static
     * @param {IC2SAccountLogin=} [properties] Properties to set
     * @returns {C2SAccountLogin} C2SAccountLogin instance
     */
    C2SAccountLogin.create = function create(properties) {
        return new C2SAccountLogin(properties);
    };

    /**
     * Encodes the specified C2SAccountLogin message. Does not implicitly {@link C2SAccountLogin.verify|verify} messages.
     * @function encode
     * @memberof C2SAccountLogin
     * @static
     * @param {IC2SAccountLogin} message C2SAccountLogin message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    C2SAccountLogin.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.accountName != null && Object.hasOwnProperty.call(message, "accountName"))
            writer.uint32(/* id 1, wireType 2 =*/10).string(message.accountName);
        if (message.password != null && Object.hasOwnProperty.call(message, "password"))
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.password);
        return writer;
    };

    /**
     * Encodes the specified C2SAccountLogin message, length delimited. Does not implicitly {@link C2SAccountLogin.verify|verify} messages.
     * @function encodeDelimited
     * @memberof C2SAccountLogin
     * @static
     * @param {IC2SAccountLogin} message C2SAccountLogin message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    C2SAccountLogin.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a C2SAccountLogin message from the specified reader or buffer.
     * @function decode
     * @memberof C2SAccountLogin
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {C2SAccountLogin} C2SAccountLogin
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    C2SAccountLogin.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.C2SAccountLogin();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.accountName = reader.string();
                    break;
                }
            case 2: {
                    message.password = reader.string();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a C2SAccountLogin message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof C2SAccountLogin
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {C2SAccountLogin} C2SAccountLogin
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    C2SAccountLogin.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a C2SAccountLogin message.
     * @function verify
     * @memberof C2SAccountLogin
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    C2SAccountLogin.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.accountName != null && message.hasOwnProperty("accountName"))
            if (!$util.isString(message.accountName))
                return "accountName: string expected";
        if (message.password != null && message.hasOwnProperty("password"))
            if (!$util.isString(message.password))
                return "password: string expected";
        return null;
    };

    /**
     * Creates a C2SAccountLogin message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof C2SAccountLogin
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {C2SAccountLogin} C2SAccountLogin
     */
    C2SAccountLogin.fromObject = function fromObject(object) {
        if (object instanceof $root.C2SAccountLogin)
            return object;
        var message = new $root.C2SAccountLogin();
        if (object.accountName != null)
            message.accountName = String(object.accountName);
        if (object.password != null)
            message.password = String(object.password);
        return message;
    };

    /**
     * Creates a plain object from a C2SAccountLogin message. Also converts values to other types if specified.
     * @function toObject
     * @memberof C2SAccountLogin
     * @static
     * @param {C2SAccountLogin} message C2SAccountLogin
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    C2SAccountLogin.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            object.accountName = "";
            object.password = "";
        }
        if (message.accountName != null && message.hasOwnProperty("accountName"))
            object.accountName = message.accountName;
        if (message.password != null && message.hasOwnProperty("password"))
            object.password = message.password;
        return object;
    };

    /**
     * Converts this C2SAccountLogin to JSON.
     * @function toJSON
     * @memberof C2SAccountLogin
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    C2SAccountLogin.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for C2SAccountLogin
     * @function getTypeUrl
     * @memberof C2SAccountLogin
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    C2SAccountLogin.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/C2SAccountLogin";
    };

    return C2SAccountLogin;
})();

$root.S2CAccountLogin = (function() {

    /**
     * Properties of a S2CAccountLogin.
     * @exports IS2CAccountLogin
     * @interface IS2CAccountLogin
     * @property {boolean|null} [success] S2CAccountLogin success
     * @property {number|Long|null} [accountId] S2CAccountLogin accountId
     * @property {Array.<ISimpleRole>|null} [roles] S2CAccountLogin roles
     */

    /**
     * Constructs a new S2CAccountLogin.
     * @exports S2CAccountLogin
     * @classdesc Represents a S2CAccountLogin.
     * @implements IS2CAccountLogin
     * @constructor
     * @param {IS2CAccountLogin=} [properties] Properties to set
     */
    function S2CAccountLogin(properties) {
        this.roles = [];
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * S2CAccountLogin success.
     * @member {boolean} success
     * @memberof S2CAccountLogin
     * @instance
     */
    S2CAccountLogin.prototype.success = false;

    /**
     * S2CAccountLogin accountId.
     * @member {number|Long} accountId
     * @memberof S2CAccountLogin
     * @instance
     */
    S2CAccountLogin.prototype.accountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

    /**
     * S2CAccountLogin roles.
     * @member {Array.<ISimpleRole>} roles
     * @memberof S2CAccountLogin
     * @instance
     */
    S2CAccountLogin.prototype.roles = $util.emptyArray;

    /**
     * Creates a new S2CAccountLogin instance using the specified properties.
     * @function create
     * @memberof S2CAccountLogin
     * @static
     * @param {IS2CAccountLogin=} [properties] Properties to set
     * @returns {S2CAccountLogin} S2CAccountLogin instance
     */
    S2CAccountLogin.create = function create(properties) {
        return new S2CAccountLogin(properties);
    };

    /**
     * Encodes the specified S2CAccountLogin message. Does not implicitly {@link S2CAccountLogin.verify|verify} messages.
     * @function encode
     * @memberof S2CAccountLogin
     * @static
     * @param {IS2CAccountLogin} message S2CAccountLogin message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    S2CAccountLogin.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.success != null && Object.hasOwnProperty.call(message, "success"))
            writer.uint32(/* id 1, wireType 0 =*/8).bool(message.success);
        if (message.accountId != null && Object.hasOwnProperty.call(message, "accountId"))
            writer.uint32(/* id 2, wireType 0 =*/16).int64(message.accountId);
        if (message.roles != null && message.roles.length)
            for (var i = 0; i < message.roles.length; ++i)
                $root.SimpleRole.encode(message.roles[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
        return writer;
    };

    /**
     * Encodes the specified S2CAccountLogin message, length delimited. Does not implicitly {@link S2CAccountLogin.verify|verify} messages.
     * @function encodeDelimited
     * @memberof S2CAccountLogin
     * @static
     * @param {IS2CAccountLogin} message S2CAccountLogin message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    S2CAccountLogin.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a S2CAccountLogin message from the specified reader or buffer.
     * @function decode
     * @memberof S2CAccountLogin
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {S2CAccountLogin} S2CAccountLogin
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    S2CAccountLogin.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.S2CAccountLogin();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.success = reader.bool();
                    break;
                }
            case 2: {
                    message.accountId = reader.int64();
                    break;
                }
            case 3: {
                    if (!(message.roles && message.roles.length))
                        message.roles = [];
                    message.roles.push($root.SimpleRole.decode(reader, reader.uint32()));
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a S2CAccountLogin message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof S2CAccountLogin
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {S2CAccountLogin} S2CAccountLogin
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    S2CAccountLogin.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a S2CAccountLogin message.
     * @function verify
     * @memberof S2CAccountLogin
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    S2CAccountLogin.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.success != null && message.hasOwnProperty("success"))
            if (typeof message.success !== "boolean")
                return "success: boolean expected";
        if (message.accountId != null && message.hasOwnProperty("accountId"))
            if (!$util.isInteger(message.accountId) && !(message.accountId && $util.isInteger(message.accountId.low) && $util.isInteger(message.accountId.high)))
                return "accountId: integer|Long expected";
        if (message.roles != null && message.hasOwnProperty("roles")) {
            if (!Array.isArray(message.roles))
                return "roles: array expected";
            for (var i = 0; i < message.roles.length; ++i) {
                var error = $root.SimpleRole.verify(message.roles[i]);
                if (error)
                    return "roles." + error;
            }
        }
        return null;
    };

    /**
     * Creates a S2CAccountLogin message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof S2CAccountLogin
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {S2CAccountLogin} S2CAccountLogin
     */
    S2CAccountLogin.fromObject = function fromObject(object) {
        if (object instanceof $root.S2CAccountLogin)
            return object;
        var message = new $root.S2CAccountLogin();
        if (object.success != null)
            message.success = Boolean(object.success);
        if (object.accountId != null)
            if ($util.Long)
                (message.accountId = $util.Long.fromValue(object.accountId)).unsigned = false;
            else if (typeof object.accountId === "string")
                message.accountId = parseInt(object.accountId, 10);
            else if (typeof object.accountId === "number")
                message.accountId = object.accountId;
            else if (typeof object.accountId === "object")
                message.accountId = new $util.LongBits(object.accountId.low >>> 0, object.accountId.high >>> 0).toNumber();
        if (object.roles) {
            if (!Array.isArray(object.roles))
                throw TypeError(".S2CAccountLogin.roles: array expected");
            message.roles = [];
            for (var i = 0; i < object.roles.length; ++i) {
                if (typeof object.roles[i] !== "object")
                    throw TypeError(".S2CAccountLogin.roles: object expected");
                message.roles[i] = $root.SimpleRole.fromObject(object.roles[i]);
            }
        }
        return message;
    };

    /**
     * Creates a plain object from a S2CAccountLogin message. Also converts values to other types if specified.
     * @function toObject
     * @memberof S2CAccountLogin
     * @static
     * @param {S2CAccountLogin} message S2CAccountLogin
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    S2CAccountLogin.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.arrays || options.defaults)
            object.roles = [];
        if (options.defaults) {
            object.success = false;
            if ($util.Long) {
                var long = new $util.Long(0, 0, false);
                object.accountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
                object.accountId = options.longs === String ? "0" : 0;
        }
        if (message.success != null && message.hasOwnProperty("success"))
            object.success = message.success;
        if (message.accountId != null && message.hasOwnProperty("accountId"))
            if (typeof message.accountId === "number")
                object.accountId = options.longs === String ? String(message.accountId) : message.accountId;
            else
                object.accountId = options.longs === String ? $util.Long.prototype.toString.call(message.accountId) : options.longs === Number ? new $util.LongBits(message.accountId.low >>> 0, message.accountId.high >>> 0).toNumber() : message.accountId;
        if (message.roles && message.roles.length) {
            object.roles = [];
            for (var j = 0; j < message.roles.length; ++j)
                object.roles[j] = $root.SimpleRole.toObject(message.roles[j], options);
        }
        return object;
    };

    /**
     * Converts this S2CAccountLogin to JSON.
     * @function toJSON
     * @memberof S2CAccountLogin
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    S2CAccountLogin.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for S2CAccountLogin
     * @function getTypeUrl
     * @memberof S2CAccountLogin
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    S2CAccountLogin.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/S2CAccountLogin";
    };

    return S2CAccountLogin;
})();

$root.C2SRoleCreate = (function() {

    /**
     * Properties of a C2SRoleCreate.
     * @exports IC2SRoleCreate
     * @interface IC2SRoleCreate
     * @property {string|null} [name] C2SRoleCreate name
     */

    /**
     * Constructs a new C2SRoleCreate.
     * @exports C2SRoleCreate
     * @classdesc Represents a C2SRoleCreate.
     * @implements IC2SRoleCreate
     * @constructor
     * @param {IC2SRoleCreate=} [properties] Properties to set
     */
    function C2SRoleCreate(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * C2SRoleCreate name.
     * @member {string} name
     * @memberof C2SRoleCreate
     * @instance
     */
    C2SRoleCreate.prototype.name = "";

    /**
     * Creates a new C2SRoleCreate instance using the specified properties.
     * @function create
     * @memberof C2SRoleCreate
     * @static
     * @param {IC2SRoleCreate=} [properties] Properties to set
     * @returns {C2SRoleCreate} C2SRoleCreate instance
     */
    C2SRoleCreate.create = function create(properties) {
        return new C2SRoleCreate(properties);
    };

    /**
     * Encodes the specified C2SRoleCreate message. Does not implicitly {@link C2SRoleCreate.verify|verify} messages.
     * @function encode
     * @memberof C2SRoleCreate
     * @static
     * @param {IC2SRoleCreate} message C2SRoleCreate message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    C2SRoleCreate.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.name != null && Object.hasOwnProperty.call(message, "name"))
            writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
        return writer;
    };

    /**
     * Encodes the specified C2SRoleCreate message, length delimited. Does not implicitly {@link C2SRoleCreate.verify|verify} messages.
     * @function encodeDelimited
     * @memberof C2SRoleCreate
     * @static
     * @param {IC2SRoleCreate} message C2SRoleCreate message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    C2SRoleCreate.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a C2SRoleCreate message from the specified reader or buffer.
     * @function decode
     * @memberof C2SRoleCreate
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {C2SRoleCreate} C2SRoleCreate
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    C2SRoleCreate.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.C2SRoleCreate();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.name = reader.string();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a C2SRoleCreate message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof C2SRoleCreate
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {C2SRoleCreate} C2SRoleCreate
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    C2SRoleCreate.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a C2SRoleCreate message.
     * @function verify
     * @memberof C2SRoleCreate
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    C2SRoleCreate.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.name != null && message.hasOwnProperty("name"))
            if (!$util.isString(message.name))
                return "name: string expected";
        return null;
    };

    /**
     * Creates a C2SRoleCreate message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof C2SRoleCreate
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {C2SRoleCreate} C2SRoleCreate
     */
    C2SRoleCreate.fromObject = function fromObject(object) {
        if (object instanceof $root.C2SRoleCreate)
            return object;
        var message = new $root.C2SRoleCreate();
        if (object.name != null)
            message.name = String(object.name);
        return message;
    };

    /**
     * Creates a plain object from a C2SRoleCreate message. Also converts values to other types if specified.
     * @function toObject
     * @memberof C2SRoleCreate
     * @static
     * @param {C2SRoleCreate} message C2SRoleCreate
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    C2SRoleCreate.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults)
            object.name = "";
        if (message.name != null && message.hasOwnProperty("name"))
            object.name = message.name;
        return object;
    };

    /**
     * Converts this C2SRoleCreate to JSON.
     * @function toJSON
     * @memberof C2SRoleCreate
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    C2SRoleCreate.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for C2SRoleCreate
     * @function getTypeUrl
     * @memberof C2SRoleCreate
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    C2SRoleCreate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/C2SRoleCreate";
    };

    return C2SRoleCreate;
})();

$root.S2CRoleCreate = (function() {

    /**
     * Properties of a S2CRoleCreate.
     * @exports IS2CRoleCreate
     * @interface IS2CRoleCreate
     * @property {ISimpleRole|null} [simpleRole] S2CRoleCreate simpleRole
     */

    /**
     * Constructs a new S2CRoleCreate.
     * @exports S2CRoleCreate
     * @classdesc Represents a S2CRoleCreate.
     * @implements IS2CRoleCreate
     * @constructor
     * @param {IS2CRoleCreate=} [properties] Properties to set
     */
    function S2CRoleCreate(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * S2CRoleCreate simpleRole.
     * @member {ISimpleRole|null|undefined} simpleRole
     * @memberof S2CRoleCreate
     * @instance
     */
    S2CRoleCreate.prototype.simpleRole = null;

    /**
     * Creates a new S2CRoleCreate instance using the specified properties.
     * @function create
     * @memberof S2CRoleCreate
     * @static
     * @param {IS2CRoleCreate=} [properties] Properties to set
     * @returns {S2CRoleCreate} S2CRoleCreate instance
     */
    S2CRoleCreate.create = function create(properties) {
        return new S2CRoleCreate(properties);
    };

    /**
     * Encodes the specified S2CRoleCreate message. Does not implicitly {@link S2CRoleCreate.verify|verify} messages.
     * @function encode
     * @memberof S2CRoleCreate
     * @static
     * @param {IS2CRoleCreate} message S2CRoleCreate message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    S2CRoleCreate.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.simpleRole != null && Object.hasOwnProperty.call(message, "simpleRole"))
            $root.SimpleRole.encode(message.simpleRole, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
        return writer;
    };

    /**
     * Encodes the specified S2CRoleCreate message, length delimited. Does not implicitly {@link S2CRoleCreate.verify|verify} messages.
     * @function encodeDelimited
     * @memberof S2CRoleCreate
     * @static
     * @param {IS2CRoleCreate} message S2CRoleCreate message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    S2CRoleCreate.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a S2CRoleCreate message from the specified reader or buffer.
     * @function decode
     * @memberof S2CRoleCreate
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {S2CRoleCreate} S2CRoleCreate
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    S2CRoleCreate.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.S2CRoleCreate();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.simpleRole = $root.SimpleRole.decode(reader, reader.uint32());
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a S2CRoleCreate message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof S2CRoleCreate
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {S2CRoleCreate} S2CRoleCreate
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    S2CRoleCreate.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a S2CRoleCreate message.
     * @function verify
     * @memberof S2CRoleCreate
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    S2CRoleCreate.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.simpleRole != null && message.hasOwnProperty("simpleRole")) {
            var error = $root.SimpleRole.verify(message.simpleRole);
            if (error)
                return "simpleRole." + error;
        }
        return null;
    };

    /**
     * Creates a S2CRoleCreate message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof S2CRoleCreate
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {S2CRoleCreate} S2CRoleCreate
     */
    S2CRoleCreate.fromObject = function fromObject(object) {
        if (object instanceof $root.S2CRoleCreate)
            return object;
        var message = new $root.S2CRoleCreate();
        if (object.simpleRole != null) {
            if (typeof object.simpleRole !== "object")
                throw TypeError(".S2CRoleCreate.simpleRole: object expected");
            message.simpleRole = $root.SimpleRole.fromObject(object.simpleRole);
        }
        return message;
    };

    /**
     * Creates a plain object from a S2CRoleCreate message. Also converts values to other types if specified.
     * @function toObject
     * @memberof S2CRoleCreate
     * @static
     * @param {S2CRoleCreate} message S2CRoleCreate
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    S2CRoleCreate.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults)
            object.simpleRole = null;
        if (message.simpleRole != null && message.hasOwnProperty("simpleRole"))
            object.simpleRole = $root.SimpleRole.toObject(message.simpleRole, options);
        return object;
    };

    /**
     * Converts this S2CRoleCreate to JSON.
     * @function toJSON
     * @memberof S2CRoleCreate
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    S2CRoleCreate.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for S2CRoleCreate
     * @function getTypeUrl
     * @memberof S2CRoleCreate
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    S2CRoleCreate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/S2CRoleCreate";
    };

    return S2CRoleCreate;
})();

$root.C2SRoleLogin = (function() {

    /**
     * Properties of a C2SRoleLogin.
     * @exports IC2SRoleLogin
     * @interface IC2SRoleLogin
     * @property {number|Long|null} [roleId] C2SRoleLogin roleId
     */

    /**
     * Constructs a new C2SRoleLogin.
     * @exports C2SRoleLogin
     * @classdesc Represents a C2SRoleLogin.
     * @implements IC2SRoleLogin
     * @constructor
     * @param {IC2SRoleLogin=} [properties] Properties to set
     */
    function C2SRoleLogin(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * C2SRoleLogin roleId.
     * @member {number|Long} roleId
     * @memberof C2SRoleLogin
     * @instance
     */
    C2SRoleLogin.prototype.roleId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

    /**
     * Creates a new C2SRoleLogin instance using the specified properties.
     * @function create
     * @memberof C2SRoleLogin
     * @static
     * @param {IC2SRoleLogin=} [properties] Properties to set
     * @returns {C2SRoleLogin} C2SRoleLogin instance
     */
    C2SRoleLogin.create = function create(properties) {
        return new C2SRoleLogin(properties);
    };

    /**
     * Encodes the specified C2SRoleLogin message. Does not implicitly {@link C2SRoleLogin.verify|verify} messages.
     * @function encode
     * @memberof C2SRoleLogin
     * @static
     * @param {IC2SRoleLogin} message C2SRoleLogin message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    C2SRoleLogin.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.roleId != null && Object.hasOwnProperty.call(message, "roleId"))
            writer.uint32(/* id 1, wireType 0 =*/8).int64(message.roleId);
        return writer;
    };

    /**
     * Encodes the specified C2SRoleLogin message, length delimited. Does not implicitly {@link C2SRoleLogin.verify|verify} messages.
     * @function encodeDelimited
     * @memberof C2SRoleLogin
     * @static
     * @param {IC2SRoleLogin} message C2SRoleLogin message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    C2SRoleLogin.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a C2SRoleLogin message from the specified reader or buffer.
     * @function decode
     * @memberof C2SRoleLogin
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {C2SRoleLogin} C2SRoleLogin
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    C2SRoleLogin.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.C2SRoleLogin();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.roleId = reader.int64();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a C2SRoleLogin message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof C2SRoleLogin
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {C2SRoleLogin} C2SRoleLogin
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    C2SRoleLogin.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a C2SRoleLogin message.
     * @function verify
     * @memberof C2SRoleLogin
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    C2SRoleLogin.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.roleId != null && message.hasOwnProperty("roleId"))
            if (!$util.isInteger(message.roleId) && !(message.roleId && $util.isInteger(message.roleId.low) && $util.isInteger(message.roleId.high)))
                return "roleId: integer|Long expected";
        return null;
    };

    /**
     * Creates a C2SRoleLogin message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof C2SRoleLogin
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {C2SRoleLogin} C2SRoleLogin
     */
    C2SRoleLogin.fromObject = function fromObject(object) {
        if (object instanceof $root.C2SRoleLogin)
            return object;
        var message = new $root.C2SRoleLogin();
        if (object.roleId != null)
            if ($util.Long)
                (message.roleId = $util.Long.fromValue(object.roleId)).unsigned = false;
            else if (typeof object.roleId === "string")
                message.roleId = parseInt(object.roleId, 10);
            else if (typeof object.roleId === "number")
                message.roleId = object.roleId;
            else if (typeof object.roleId === "object")
                message.roleId = new $util.LongBits(object.roleId.low >>> 0, object.roleId.high >>> 0).toNumber();
        return message;
    };

    /**
     * Creates a plain object from a C2SRoleLogin message. Also converts values to other types if specified.
     * @function toObject
     * @memberof C2SRoleLogin
     * @static
     * @param {C2SRoleLogin} message C2SRoleLogin
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    C2SRoleLogin.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults)
            if ($util.Long) {
                var long = new $util.Long(0, 0, false);
                object.roleId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
                object.roleId = options.longs === String ? "0" : 0;
        if (message.roleId != null && message.hasOwnProperty("roleId"))
            if (typeof message.roleId === "number")
                object.roleId = options.longs === String ? String(message.roleId) : message.roleId;
            else
                object.roleId = options.longs === String ? $util.Long.prototype.toString.call(message.roleId) : options.longs === Number ? new $util.LongBits(message.roleId.low >>> 0, message.roleId.high >>> 0).toNumber() : message.roleId;
        return object;
    };

    /**
     * Converts this C2SRoleLogin to JSON.
     * @function toJSON
     * @memberof C2SRoleLogin
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    C2SRoleLogin.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for C2SRoleLogin
     * @function getTypeUrl
     * @memberof C2SRoleLogin
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    C2SRoleLogin.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/C2SRoleLogin";
    };

    return C2SRoleLogin;
})();

$root.S2CRoleLogin = (function() {

    /**
     * Properties of a S2CRoleLogin.
     * @exports IS2CRoleLogin
     * @interface IS2CRoleLogin
     * @property {boolean|null} [success] S2CRoleLogin success
     */

    /**
     * Constructs a new S2CRoleLogin.
     * @exports S2CRoleLogin
     * @classdesc Represents a S2CRoleLogin.
     * @implements IS2CRoleLogin
     * @constructor
     * @param {IS2CRoleLogin=} [properties] Properties to set
     */
    function S2CRoleLogin(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * S2CRoleLogin success.
     * @member {boolean} success
     * @memberof S2CRoleLogin
     * @instance
     */
    S2CRoleLogin.prototype.success = false;

    /**
     * Creates a new S2CRoleLogin instance using the specified properties.
     * @function create
     * @memberof S2CRoleLogin
     * @static
     * @param {IS2CRoleLogin=} [properties] Properties to set
     * @returns {S2CRoleLogin} S2CRoleLogin instance
     */
    S2CRoleLogin.create = function create(properties) {
        return new S2CRoleLogin(properties);
    };

    /**
     * Encodes the specified S2CRoleLogin message. Does not implicitly {@link S2CRoleLogin.verify|verify} messages.
     * @function encode
     * @memberof S2CRoleLogin
     * @static
     * @param {IS2CRoleLogin} message S2CRoleLogin message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    S2CRoleLogin.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.success != null && Object.hasOwnProperty.call(message, "success"))
            writer.uint32(/* id 1, wireType 0 =*/8).bool(message.success);
        return writer;
    };

    /**
     * Encodes the specified S2CRoleLogin message, length delimited. Does not implicitly {@link S2CRoleLogin.verify|verify} messages.
     * @function encodeDelimited
     * @memberof S2CRoleLogin
     * @static
     * @param {IS2CRoleLogin} message S2CRoleLogin message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    S2CRoleLogin.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a S2CRoleLogin message from the specified reader or buffer.
     * @function decode
     * @memberof S2CRoleLogin
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {S2CRoleLogin} S2CRoleLogin
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    S2CRoleLogin.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.S2CRoleLogin();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.success = reader.bool();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a S2CRoleLogin message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof S2CRoleLogin
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {S2CRoleLogin} S2CRoleLogin
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    S2CRoleLogin.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a S2CRoleLogin message.
     * @function verify
     * @memberof S2CRoleLogin
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    S2CRoleLogin.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.success != null && message.hasOwnProperty("success"))
            if (typeof message.success !== "boolean")
                return "success: boolean expected";
        return null;
    };

    /**
     * Creates a S2CRoleLogin message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof S2CRoleLogin
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {S2CRoleLogin} S2CRoleLogin
     */
    S2CRoleLogin.fromObject = function fromObject(object) {
        if (object instanceof $root.S2CRoleLogin)
            return object;
        var message = new $root.S2CRoleLogin();
        if (object.success != null)
            message.success = Boolean(object.success);
        return message;
    };

    /**
     * Creates a plain object from a S2CRoleLogin message. Also converts values to other types if specified.
     * @function toObject
     * @memberof S2CRoleLogin
     * @static
     * @param {S2CRoleLogin} message S2CRoleLogin
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    S2CRoleLogin.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults)
            object.success = false;
        if (message.success != null && message.hasOwnProperty("success"))
            object.success = message.success;
        return object;
    };

    /**
     * Converts this S2CRoleLogin to JSON.
     * @function toJSON
     * @memberof S2CRoleLogin
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    S2CRoleLogin.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for S2CRoleLogin
     * @function getTypeUrl
     * @memberof S2CRoleLogin
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    S2CRoleLogin.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/S2CRoleLogin";
    };

    return S2CRoleLogin;
})();

module.exports = $root;
